package proyecto.ort.edu.uy.web.presentacion;

import java.util.List;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.bean.ViewScoped;
import javax.faces.model.SelectItem;

import proyecto.ort.edu.uy.dominio.Nota;
import proyecto.ort.edu.uy.dominio.Tarea;
import proyecto.ort.edu.uy.manager.NotaManagerLocal;
import proyecto.ort.edu.uy.manager.TareaManagerLocal;

@ManagedBean(name="notaBean")
@SessionScoped
public class NotasTareaBean extends AbstractBaseBean {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8488362593871217090L;

	@EJB
	private TareaManagerLocal tareaBean;
	
	
	public Nota nota;
	public Tarea tarea;

	private String selectedItem;
	private List<SelectItem> selectItemsDuracionTarea;
	
	
	
	
	
	public String getSelectedItem() {
		return selectedItem;
	}

	public void setSelectedItem(String selectedItem) {
		this.selectedItem = selectedItem;
	}

	public List<SelectItem> getSelectItemsDuracionTarea() {
		return super.getSelectItemsDuracionTarea();
	}

	public void setSelectItemsDuracionTarea(List<SelectItem> selectItemsDuracionTarea) {
		this.selectItemsDuracionTarea = selectItemsDuracionTarea;
	}

	public Nota getNota() {
		return nota;
	}

	public void setNota(Nota nota) {
		this.nota = nota;
	}

	public Tarea getTarea() {
		return tarea;
	}

	public void setTarea(Tarea tarea) {
		this.tarea = tarea;
	}

	public NotasTareaBean() {
		// TODO Auto-generated constructor stub
	}

	@PostConstruct
	private void cargarDatos() {
		tarea = this.tareaBean.buscarPorId(new Long(4));
		this.selectedItem = this.tarea.getUnidadTiempoEstimado();
		nota = new Nota();

	}

	public String cargarPagina() {
		String outcome = "/paginas/notasTareaForm";
		return outcome;
	}

}
